package youxiao.bytezon.views.commons;

import java.util.List;
import java.util.function.Function;

import org.springframework.data.domain.Page;

import com.google.common.collect.Lists;

public class PageListView<V> extends PaginationView {

	private List<V> list = Lists.newArrayList();

	public <E> PageListView(Page<E> page, Function<? super E, V> transform) {
		super(page);

		for (E item : page) {
			this.list.add(transform.apply(item));
		}
	}

	public List<V> getList() {
		return list;
	}

	public void setList(List<V> list) {
		this.list = list;
	}

}
